/**
 * Created by Administrator on 2017/2/15.
 */

$(function(){

    $('#edit').each(function(){
        $url=$(this).attr('url');
        $(this).click(function(){
            $.ajax({
                type: "post",
                url: $url,
                data: {realname:$('input[name=realname]').val(),
                    id_card:$('input[name=id_card]').val(),
                    credit_card:$('input[name=credit_card]').val()},
                dataType: "json",
                success: function(data){
                    if(data.code==200){
                        alert(data.message);
                        location.href=data.url;
                    }else{
                        alert(data.message);
                        return;
                    }
                }
            });
        });
    });

})